//
//  Background.m
//  iosTest
//
//  Created by Neutrino on 11-5-25.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "Background.h"
//#include <>


@implementation Background

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}
//--------------
-(IBAction)onBack:(id)sender
{
    [self.view setBackgroundColor:[UIColor colorWithRed:128 green:128 blue:0 alpha:0.5]];
}

-(IBAction)onEnter
{
    NSMutableString* imgPath = [[NSMutableString alloc] initWithCapacity:1];
    [imgPath appendString:@"~/Pictures/"];
    [imgPath appendString:[textField text]];
    [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageWithContentsOfFile:imgPath]]];
    [imgPath release];
}
//--------------

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
   // [self.view setBackgroundColor:[UIColor colorWithRed:128 green:128 blue:128 alpha:0.5]];

}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
	return YES;
}

@end
